<!-- 筛选菜单 -->
<div class="toper-menu" ng-if="$parent.flag == false">
    <md-radio-group ng-model="initState.code" ng-change="radioSwitch(initState.code)">
        <md-radio-button ng-repeat="stateInfo in manageStateArr" ng-value="stateInfo.code" class="md-primary">
            {{stateInfo.dscp}} <span ng-bind=" '(' + stateInfo.sum + ')' "></span>
        </md-radio-button>
        <div class="clear"></div>
    </md-radio-group>
</div>
<div class="food-confirm-wrapper">
    <!-- 未出餐 -->
    <div class="food-list" ng-repeat="foodInfo in foodList.orderfoodlist" ng-if="initState.code == 1 && foodInfo.arrive == 0" ng-if="$parent.flag == false">
        <ul>
            <li>
                <div class="food-header">
                    <p class="time" data-icon="&#xe60e;">
                        {{foodInfo.cjTime}}
                    </p>
                    <a class="print fr" target="_blank" href="page/printOrder.html?shopId={{userInfo.shopId}}&orderNum={{foodInfo.orderNum}}" data-icon="&#xe622;">打印</a>
                </div>

                <div class="food-body clearfix">
                    <div class="order-info">
                        <div class="food-item">

                            <p class="order-num">
                                订单
                                <span class="hoverLnk" ng-mouseenter="hover = true" ng-mouseleave="hover = false">{{foodInfo.orderNum}}</span>
                                <button data-icon="&#xe60d;" ng-click="showTabDialog($event, foodInfo)" ng-if="foodInfo.ktvOrderNum != ''">预订订单</button>
                            </p>

                            <p class="food">餐点</p>
                            <ul>
                                <li ng-repeat="foodList in foodInfo.foodMealList"><span class="food-name">{{foodList.foodName}}</span><em>x</em> <span>{{foodList.foodNumber}}</span></li>
                            </ul>
                            <p class="attention">备注<span>{{foodInfo.message?foodInfo.message:"无"}}</span></p>


                            <!-- 订单hover -->
                            <div class="hoverOrder-wrapper" ng-class="{hoverActive: hover}">
                                <div class="hover-content clearfix">
                                    <img ng-src="{{foodInfo.uImg}}" alt="" />
                                    <p><span>{{foodInfo.uTell}}</span><span class="fr"><em>总计</em>{{foodInfo.cashValue}} <em>元</em></span></p>
                                    <p class="">{{foodInfo.userName}} <span class="fr">实付 <em class="price">{{foodInfo.payCash}}</em> 元</span></p>
                                </div>
                                <span class="triangle-up"></span>
                                <span class="triangle-up2"></span>
                            </div>

                        </div>
                    </div>
                    <!-- 按钮 -->
                    <div class="relevance-box fr">
                        <div class="box-num">
                            {{foodInfo.tableTypeName}}
                            <p>{{foodInfo.tableName?foodInfo.tableName:'未指定'}}</p>
                        </div>
                        <button ng-if="foodInfo.arrive == 0" ng-click="foodOut($event, foodInfo)">出餐</button>
                        <button ng-if="foodInfo.arrive == 1" class="send-out">已出餐</button>
                    </div>
                </div>
            </li>
        </ul>
    </div>
    <!-- 已出餐 -->
    <div class="food-list" ng-repeat="foodInfo in foodList.orderfoodlist" ng-if="initState.code == 2 && foodInfo.arrive != 0" ng-if="$parent.flag == false">
        <ul>
            <li>
                <div class="food-header">
                    <p class="time" data-icon="&#xe60e;">
                        {{foodInfo.cjTime}}
                    </p>
                    <a class="print fr" target="_blank" href="page/printOrder.html?shopId={{userInfo.shopId}}&orderNum={{foodInfo.orderNum}}" data-icon="&#xe622;">打印</a>
                </div>
                <div class="food-body clearfix">
                    <div class="order-info">
                        <div class="food-item">

		                    <p class="order-num">
                                订单
		                        <span class="hoverLnk" ng-mouseenter="hover = true" ng-mouseleave="hover = false">{{foodInfo.orderNum}}</span>
		                        <button data-icon="&#xe60d;" ng-click="showTabDialog($event, foodInfo)" ng-if="foodInfo.ktvOrderNum != ''">预订订单</button>
		                    </p>
		                    <!-- 订单hover -->
		                    <div class="hoverOrder-wrapper" ng-class="{hoverActive: hover}">
		                        <div class="hover-content clearfix">
		                            <img src="img/avatar2.png" alt="" />
		                            <p><span>{{foodInfo.uTell}}</span><span class="fr"><em>总计</em>{{foodInfo.cashValue}} <em>元</em></span></p>
		                            <p class="">{{foodInfo.userName}} <span class="fr">实付 <em class="price">{{foodInfo.payCash}}</em> 元</span></p>
		                        </div>
		                        <span class="triangle-up"></span>
		                        <span class="triangle-up2"></span>
		                    </div>

                            <p>餐点</p>
                            <ul>
                                <li ng-repeat="foodList in foodInfo.foodMealList"><span class="food-name">{{foodList.foodName}}</span><em>x</em> <span>{{foodList.foodNumber}}</span></li>
                            </ul>
                            <p class="attention">备注<span>{{foodInfo.message?foodInfo.message:"无"}}</span></p>
                        </div>
                    </div>
                    <!-- 按钮 -->
                    <div class="relevance-box fr">
                        <div class="box-num">
                            {{foodInfo.tableTypeName}}
                            <p>{{foodInfo.tableName?foodInfo.tableName:'未指定'}}</p>
                        </div>
                        <button class="send-out">已出餐</button>
                    </div>
                </div>
            </li>
        </ul>
    </div>

    <!-- 搜索 -->
    <div class="food-list" ng-repeat="foodInfo in foodList.data" ng-if="foodInfo.type == 2">
        <ul>
            <li>
                <div class="food-header">
                    <p class="time" data-icon="&#xe60e;">
                        {{foodInfo.startTime}}
                    </p>
                    <a class="print fr" target="_blank" href="page/printOrder.html?shopId={{userInfo.shopId}}&orderNum={{foodInfo.orderNum}}" data-icon="&#xe622;">打印</a>
                </div>
                <div class="food-body clearfix">
                    <div class="order-info">
                        <div class="food-item">
                        	<p class="order-num fr">
                                订单
		                        <span class="hoverLnk" ng-mouseenter="hover = true" ng-mouseleave="hover = false">{{foodInfo.orderNum}}</span>
		                        <button data-icon="&#xe60d;" ng-click="showTabDialog($event, foodInfo)">预订订单</button>
		                    </p>
                            <p>餐点</p>
                            <ul>
                                <li ng-repeat="foodList in foodInfo.foodList"><span class="food-name">{{foodList.foodName}}</span><em>x</em> <span>{{foodList.foodNumber}}</span></li>
                            </ul>
                            <p class="attention">备注<span>{{foodInfo.mark?foodInfo.mark:"无"}}</span></p>

                            <!-- 订单hover -->
		                    <div class="hoverOrder-wrapper" ng-class="{hoverActive: hover}">
		                        <div class="hover-content clearfix">
		                            <img src="img/avatar2.png" alt="">
		                            <p><span>{{foodInfo.userPhone}}</span><span class="fr"><em>总计</em>{{foodInfo.cashValue}} <em>元</em></span></p>
		                            <p class="">{{foodInfo.userName}} <span class="fr">实付 <em class="price">{{foodInfo.payCash}}</em> 元</span></p>
		                        </div>
		                        <span class="triangle-up"></span>
		                        <span class="triangle-up2"></span>
		                    </div>
                        </div>
                    </div>
                    <!-- 按钮 -->
                    <div class="relevance-box fr">
                        <div class="box-num">
                            {{foodInfo.tableTypeName}}
                            <p>{{foodInfo.tableName?foodInfo.tableName:'未指定'}}</p>
                        </div>
                        <button class="send-out">已出餐</button>
                    </div>
                </div>
            </li>
        </ul>
    </div>

    <!-- 空白页面 -->
    <div class="nodate" ng-if="initState.code == 1 && manageStateArr[0].sum === 0" style="text-align: center;">
        <img src="img/no_tuidan.png" alt="">
        <h1>还没人找您点餐</h1>
        <p>要不然您再等等</p>
    </div>
    <div class="nodate" ng-if="initState.code == 2 && manageStateArr[1].sum === 0" style="text-align: center;">
        <img src="img/no_tuidan.png" alt="">
        <h1>还没人找您点餐</h1>
        <p>要不然您再等等</p>
    </div>
</div>

<!-- 关联订单弹窗 -->
<script type="text/ng-template" id="foodTabDialog.tmpl.html">
    <md-dialog aria-label="Mango (Fruit)" style="padding: 20px;" class="food-dialog-wrapper">
        <form>
            <md-dialog-content style="max-width:800px;max-height:810px;">
                <div class="md-dialog-content md-box clearfix">
                    <div class="foodConfirm-header">
                        <p class="time" data-icon="&#xe60e;">{{foodInfo.startTime}}</p>
                        <p class="order-num fr">
                            <span>订单 {{foodInfo.orderNum}}</span>
                        </p>
                    </div>
                    <div class="foodConfirm-body clearfix">
                        <div class="order-info">
                            <div class="user-info">
                                <img ng-if="foodInfo.userImg == ''" src="img/avatar2.png" alt="">
                                <img ng-if="foodInfo.userImg != ''" ng-src="foodInfo.userImg" alt="">
                                <div>
                                    <p>{{foodInfo.userPhone}}</p>
                                    <p class="name">{{foodInfo.userName}}</p>
                                </div>
                            </div>
                            <div class="activity">
                                <p>活动<span>{{foodInfo.activeName?foodInfo.activeName:'无'}}</span></p>
                                <p ng-if="foodInfo.message != ''">备注<span>{{foodInfo.userMsg?foodInfo.userMsg:'无'}}</span></p>
                            </div>
                        </div>
                        <!-- 价格 & 状态 -->
                        <div class="price">
                            <p><em class="total">总计</em><span>{{foodInfo.cashValue}}</span><em class="yuan">元</em></p>
                            <p class="actual-pay"><em class="total">实付</em><span>{{foodInfo.payCash}}</span><em class="yuan">元</em></p>
                            <button ng-if="foodInfo.arrive == 1">未出餐</button>
                            <button ng-if="foodInfo.arrive == 0">已出餐</button>
                        </div>
                    </div>
                </div>
            </md-dialog-content>
        </form>
    </md-dialog>
</script>
